#if !defined(AFX_PRINTREPORT_H__11A7CB50_A241_4D54_9DBB_FC2EC87832DF__INCLUDED_)
#define AFX_PRINTREPORT_H__11A7CB50_A241_4D54_9DBB_FC2EC87832DF__INCLUDED_

#include "../Common/LinkEdit.h"
#include "../Common/GYDataSet.h"

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// PrintReport.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CPrintReport dialog

class CPrintReport : public CDialog
{
// Construction
public:
	CPrintReport(CWnd* pParent = NULL);   // standard constructor

// Dialog Data
	//{{AFX_DATA(CPrintReport)
	enum { IDD = IDD_DIALOG_PRINT_REPORT };
	CLinkEdit	m_edtSerialNo;
	CLinkEdit	m_edtName;
	CLinkEdit	m_edtMedicaRecordNo;
	CString	m_strWeight;
	CString	m_strBirth;
	CString	m_strGender;
	CString	m_strAddress;
	CString	m_strPhoneNo;
	CString	m_strDoctorDesc;
	CString	m_str1stDoctor;
	CString	m_str1stTime;
	CString	m_strClinical;
	CString	m_strStature;
	//}}AFX_DATA


// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CPrintReport)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

	virtual void OnOK();
	virtual void OnCancel();

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(CPrintReport)
	afx_msg void OnButtonCancel();
	afx_msg void OnButtonPrint();
	virtual BOOL OnInitDialog();
	afx_msg void OnCheckGaitGraph();
	afx_msg void OnSelchangeComboDatesGait();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

public:
	static BOOL				KeyFieldsCheck(LPVOID pParam);
	static BOOL				LostFocusCheck(LPVOID pParam);

private:
	BOOL					ShowTablePatientInfo(CLinkEdit* pLinkEdit, CString strFieldName, CString strFieldValue);
	BOOL					ShowPatientInfoFromTable(CGYDataSet* pDataSet, int nIndex);

	BOOL					PrintScale(CDC* pDC, CPrintInfo* pInfo, UINT& nPageNum, UINT unPageTotal, TCHAR* szScaleName);

	void					PrintPageTitle(CDC* pDC, CPrintInfo* pInfo, UINT unPageTotal, UINT nPageNum, CString strTitle, BOOL bDrawDiagSN = FALSE);
	void					PrintPageFoot(CDC* pDC, CRect rectPage, UINT unPageTotal, UINT nPageNum);
		
	CString					GetIniStringValue(CString strSection, CString strKey);
	int						GetIniIntValue(CString strSection, CString strKey);
	BOOL					PrintTableData(CDC* pDC, CString strMRN, int nDiagSN, CString strDaigDate, DWORD dwScaleID, POINT* ppCtrlArrays[], int nColCtrlCount, POINT pDateLabelArray[]);

	BOOL					PrintDoctorWriteScale(CDC* pDC, CPrintInfo* pInfo, UINT unPageTotal, UINT& nPageNum);
	CString					GetDoctorWriteString();

	BOOL					PreparePrint(CDC* pDC, CPrintInfo* pInfo);
	BOOL					ClearUpPrint(CDC* pDC, BOOL bPrintingOK);

	int						SumPrintPageCount();

	BOOL					PrintZNP(CDC* pDC, CPrintInfo* pInfo, int nTotalPage, UINT& nPageIndex, BOOL bZhusu, BOOL bNow, BOOL bPast);

	BOOL					PrintFirstPage(CDC* pDC, CPrintInfo* pInfo, int nTotalPage, UINT& nPageIndex);
	BOOL					PrintGaitGraph(CDC* pDC, CPrintInfo* pInfo, int nTotalPage, UINT& nPageIndex);
	BOOL					PrintGaitInFirstPage(CDC* pDC, CPrintInfo* pInfo);

	BOOL					PrintOneString(CDC* pDC, CPrintInfo* pInfo, int nTotalPage, UINT& nPageIndex, CString strTitle, CString strString, BOOL bDrawDiagSN = FALSE);

	CString					GetHospitalName();

private:
	CFont*					m_pFontForName;
	CFont*					m_pFontTitle;
	CFont*					m_pFontBody;

	CString					m_strMRN;
	CString					m_strMRNCode;
	CString					m_strPatName;
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_PRINTREPORT_H__11A7CB50_A241_4D54_9DBB_FC2EC87832DF__INCLUDED_)
